<?php
namespace App\Http\Controllers\home;
use App\Http\Controllers\Controller;
use Illuminate\support\facades\input;
use DB;
   class SearchController extends Controller{
      public function search_list(){
          $input = input::all();
          $key = $input['key'];
          if(empty($key)){
              $data = DB::table('mo_goods')->get();
          }else{
              $data = DB::table('mo_goods')->where('g_name', 'like', '%'.$key.'%')->get();
          }
          return view('home.search.search_list',compact('data'));
       }
       public function price_citem($s_num,$b_num){
           $data = DB::table('mo_goods')->where('g_price', '<', $b_num)->where('g_price', '>', $s_num)->get();
           return view('home.search.search_list',compact('data'));
           //var_dump($data);
       }
   }
?>

